CC = gcc
CFLAGS = -Wall -g -O2
LDFLAGS = -lm -lrt -lpthread

all: par seq

monte-carlo-par.o: monte-carlo-par.c
	${CC} ${CFLAGS} -c monte-carlo-par.c

monte-carlo-seq.o: monte-carlo-seq.c
	${CC} ${CFLAGS} -c monte-carlo-seq.c

par: monte-carlo-par.o
	${CC} ${CFLAGS} monte-carlo-par.o ${LDFLAGS} -o monte-carlo-par

seq: monte-carlo-seq.o
	${CC} ${CFLAGS} monte-carlo-seq.o ${LDFLAGS} -o monte-carlo-seq

clean:
	rm -f monte-carlo-seq monte-carlo-par *.o

test: all
	bash runTests.sh
